<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link
      rel="stylesheet"
      href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.0/css/bootstrap.min.css"
    />
    <link
      rel="shortcut icon"
      href="https://codehhr.cn/img/favicon.ico"
      type="image/x-icon"
    />
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <style>
      .container {
        margin: 40px auto;
      }
      .submit {
        margin: 10px 0;
      }
      button {
        outline: none !important;
      }
    </style>
    <title>Document</title>
  </head>
  <body>
    <div class="container">
      <div class="panel panel-info">
        <div class="panel-heading">
          <h3 class="panel-title">修改评论</h3>
        </div>
        <div class="panel-body">
          <textarea
            id="input"
            class="form-control"
            rows="3"
            required="required"
          ></textarea>
          <button type="button" class="btn btn-info submit">提交</button>
        </div>
      </div>
    </div>
    <script>
      $(function () {
        $(".submit").click(function () {
          let newComment = $("textarea").val();
          let userid = location.href.split("=")[1];

          $.get(`/edit?newcomment=${newComment}&userid=${userid}`, function () {
            location.href = "./index.html";
          });
        });
      });
    </script>
  </body>
</html>
